{% extends "student/stu_header.html" %}
{% block context %}
    <div class="page_header">
        <h3 align="center">学生选课</h3>
    </div>
    <div class="container">
        <table class="table table-hover">
            <tr>
                <th scope="col">课程名称</th>
                <th scope="col">教师编号</th>
                <th scope="col">上课时间</th>
                <th scope="col">选择</th>
            </tr>
            </thead>
            <tbody>
            {% for course in courses %}
                
                <tr>
                    <td>{{ course.course_id }}</td>
                    <td>{{ course.teacher_id }}</td>
                    <td>{{ course.time }}</td>
                    {% if course.course_id not in stu_list %}
                        <td><button type="submit" class="btn btn-primary" onclick="window.location.href='/stu_choose_order?teacher_choice_id={{ course.teacher_choice_id }}'">选择</button></td>
                    {% else %}
                        <td><button type="submit" class="btn btn-info">已选</button></td>
                    {% endif %}
                </tr>
                
            {% empty %}
                <div class="alert alert-info" role="alert">
                    <strong>抱歉</strong>
                    老师暂时没有选课
                </div>
            {% endfor %}
            </tbody>
        </table>
    </div>
{% endblock context %}